
const optionsCache = {
  state: {
    data:[],
    count: {},
  },
  mutations: {
    SET_CACHE: (state, object) => {
      state.data.push(object)
    },
    SET_CACHE_COUNT: (state, object) => {
      // object.status noRequest 已经请求,requesting 正在请求, requested 请求完成
      state.count[object.key] = object.status
    },
  },
  actions: {
    setCatch: ({commit}, object) => {
        commit('SET_CACHE', object)
    },
    // 表示同一个接口进行了渲染查询几次了，
    setCatchCount: ({commit}, object) => {
      commit('SET_CACHE_COUNT', object)
    },
  }
}

export default optionsCache
